home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
wdj0796.zip
/
RAJA.ZIP
/
SPLITTER.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-03-08
|
2KB
|
63 lines
// splitter.cpp : implementation file
//
#include "stdafx.h"
#include "generic.h"
#include "splitter.h"
#include "myform.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSplitterFrame
IMPLEMENT_DYNCREATE(CSplitterFrame, CMDIChildWnd)
CSplitterFrame::CSplitterFrame()
{
}
CSplitterFrame::~CSplitterFrame()
{
}
BOOL CSplitterFrame::OnCreateClient(LPCREATESTRUCT,
CCreateContext* pContext)
{
if (!m_wndSplitter.CreateStatic (this, 2, 1))
return FALSE;
CSize sizeInit (200, 100); // arbitrary!
m_wndSplitter.CreateView (0, 0, RUNTIME_CLASS (CMyFormView),
sizeInit, pContext);
m_wndSplitter.CreateView (1, 0, RUNTIME_CLASS (CMyFormView),
sizeInit, pContext);
((CMyFormView *)m_wndSplitter.GetPane (0, 0))->SetCaption
("Form #1");
((CMyFormView *)m_wndSplitter.GetPane (1, 0))->SetCaption
("Form #2");
return TRUE;
}
BEGIN_MESSAGE_MAP(CSplitterFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CSplitterFrame)
ON_COMMAND(ID_VIEW_SWITCHVIEW, OnViewSwitchView)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/**************************************************************************/
// OnViewSwitchView
// If the pane (0, 0) is active, the set (1,0) as active, else set (0,0)
// as active.
/**************************************************************************/
void CSplitterFrame::OnViewSwitchView()
{
int nRow = (GetActiveView () ==
(CView*)m_wndSplitter.GetPane (0, 0)) ? 1 : 0;
SetActiveView((CView*)m_wndSplitter.GetPane(nRow, 0));
}